/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package cl.zeke.pizzastore.negocio.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author taller
 */
@Embeddable
public class PizzaIngredientePK implements Serializable {
    @Basic(optional = false)
    @Column(name = "ID_PIZZA")
    private long idPizza;
    @Basic(optional = false)
    @Column(name = "ID_INGREDIENTE")
    private long idIngrediente;

    public PizzaIngredientePK() {
    }

    public PizzaIngredientePK(long idPizza, long idIngrediente) {
        this.idPizza = idPizza;
        this.idIngrediente = idIngrediente;
    }

    public long getIdPizza() {
        return idPizza;
    }

    public void setIdPizza(long idPizza) {
        this.idPizza = idPizza;
    }

    public long getIdIngrediente() {
        return idIngrediente;
    }

    public void setIdIngrediente(long idIngrediente) {
        this.idIngrediente = idIngrediente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idPizza;
        hash += (int) idIngrediente;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PizzaIngredientePK)) {
            return false;
        }
        PizzaIngredientePK other = (PizzaIngredientePK) object;
        if (this.idPizza != other.idPizza) {
            return false;
        }
        if (this.idIngrediente != other.idIngrediente) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cl.zeke.pizzastore.negocio.entities.PizzaIngredientePK[ idPizza=" + idPizza + ", idIngrediente=" + idIngrediente + " ]";
    }
    
}
